import moment from 'moment'

export const yesterday = () => {
  let yesterday = moment().subtract(1, 'days')
  return yesterday.format('YYYY-MM-DD')
}
export const dateFormat = (date) => {
  if (date == '--') return date
  return moment(date).format('YYYY-MM-DD')
}
export const timeFormat = (date) => {
  if (date == '--') return date
  return moment(date).format('YYYY-MM-DD HH:mm:ss')
}

export const shortcuts = [
  {
    text: '今日',
    value: new Date()
  },
  {
    text: '明日',
    value: () => {
      const date = new Date()
      date.setTime(date.getTime() + 3600 * 1000 * 24)
      return date
    }
  },
  {
    text: '后日',
    value: () => {
      const date = new Date()
      date.setTime(date.getTime() + 3600 * 1000 * 24 * 2)
      return date
    }
  }
]
// 便签类型
export const zcType = ['', '', '', '']
